package com.benin.sms

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.switchMap
import com.benin.sms.base.BaseViewModel
import com.benin.sms.model.ToDoLoginTo
import com.benin.sms.network.RepoLaunch

class ViewModelLogin : BaseViewModel() {

    private val mLiveDataDoLogin = MutableLiveData<ToDoLoginTo>()

    val LiveDataDoLogin = mLiveDataDoLogin.switchMap { query ->
        RepoLaunch.doLogin(this, query)
    }

    fun doLogin(doLoginReq: ToDoLoginTo) {
        mLiveDataDoLogin.value = doLoginReq
    }
}